<?php 
$data['page_selected'] = 'reports';
$this->load->view('constants/header', $data);
if($report_loaded == 'report loaded'){ ?>
	<script type="text/javascript">
		alert('Actividad cargada exitosamente');
	</script>
<?php } ?>

<div id="site_content">
	<?php $this->load->view('constants/sidebar'); ?> 
    <div id="content">
        <!-- insert the page content here -->
        <h3>Reportes</h3>
        <p>
        	Reporte cargado &nbsp;&nbsp; <img src="<?php echo base_url().IMG ?>greenDot.png" /><br />
			Semana sin reporte &nbsp;&nbsp; <img src="<?php echo base_url().IMG ?>alerta.gif" />
        </p>
        <?php 
		if(count($reports) > 0) {?>
            <table width="100%">
                <thead>
                    <th align="center"></th>
                    <th align="center">
                        Desde
                    </th>
                    <th align="center">
                        Hasta
                    </th>
                    <th align="center"></th>
                </thead>
                <?php $cont = 1;
                    foreach($reports as $r){ ?>
                    <tr>
                        <td align="center">
                            Semana <?php echo $cont; ?>
                        </td>
                        <td align="center">
                            <?php echo $r['date_start'] ?>
                        </td>
                        <td align="center">
                            <?php echo $r['date_end'] ?>
                        </td>
                        <td align="center" width="100px">
                            <?php if($r['report']){ ?>
                                <img src="<?php echo base_url().IMG ?>greenDot.png" />
                            <?php } 
                            else {?>
                                <img src="<?php echo base_url().IMG ?>alerta.gif" />
                                &nbsp;&nbsp; 
                                <a href="<?php echo base_url(); ?>activity/new_report/<?php echo change2ymd($r['date_start']); ?>/<?php echo change2ymd($r['date_end']); ?>">Cargar</a>
                            <?php } ?>
                        </td>
                    </tr>
                <?php $cont++;
                    } ?>
            </table>
        <?php }
		else { ?>
        	<h1 align="center">El integrante no posee semanas para cargar reportes.</h1>
        <?php } ?>
        
        
    </div>
</div>
<?php $this->load->view('constants/footer'); ?>